import { fromJS } from 'immutable'
import * as actionTypes from './actionTypes'

const defaultState = fromJS({
  loginStatus: false
})

const reducer = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.LOGIN_USER:
      return state.set('loginStatus', action.status);
    case actionTypes.CHANGE_LOGOUT:
      return state.set('loginStatus', false)
    default:
      break;
  }
  return state

}

export default reducer
